﻿<Window x:Class="SampleTransaq.QuotesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Name="quotesWindow" Title="QuotesWindow" Height="600" Width="280">
    <Grid>
        <ListView ItemsSource="{Binding ElementName=quotesWindow, Path=Quotes}">
			<ListView.View>
				<GridView>
					<GridViewColumn Width="70" Header="Продажа">
						<GridViewColumn.CellTemplate>
							<DataTemplate>
								<TextBlock x:Name="AskCtrl" Text="{Binding Path=Volume}" TextAlignment="Center" />
								<DataTemplate.Triggers>
									<DataTrigger Binding="{Binding Path=OrderDirection}" Value="Sell">
										<Setter TargetName="AskCtrl" Property="Visibility" Value="Visible" />
									</DataTrigger>
									<DataTrigger Binding="{Binding Path=OrderDirection}" Value="Buy">
										<Setter TargetName="AskCtrl" Property="Visibility" Value="Hidden" />
									</DataTrigger>
								</DataTemplate.Triggers>
							</DataTemplate>
						</GridViewColumn.CellTemplate>
					</GridViewColumn>
					<GridViewColumn Width="100" Header="Цена" DisplayMemberBinding="{Binding Path=Price}" />
					<GridViewColumn Width="70" Header="Покупка">
						<GridViewColumn.CellTemplate>
							<DataTemplate>
								<TextBlock x:Name="BidCtrl" Text="{Binding Path=Volume}" TextAlignment="Center" />
								<DataTemplate.Triggers>
									<DataTrigger Binding="{Binding Path=OrderDirection}" Value="Buy">
										<Setter TargetName="BidCtrl" Property="Visibility" Value="Visible" />
									</DataTrigger>
									<DataTrigger Binding="{Binding Path=OrderDirection}" Value="Sell">
										<Setter TargetName="BidCtrl" Property="Visibility" Value="Hidden" />
									</DataTrigger>
								</DataTemplate.Triggers>
							</DataTemplate>
						</GridViewColumn.CellTemplate>
					</GridViewColumn>
				</GridView>
			</ListView.View>
		</ListView>
    </Grid>
</Window>
